/*
 * 	<pre>
 *	EasyPeas.
 *  Copyright (C) 2007 S Owen
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public
 *  License as published by the Free Software Foundation; either
 *  version 2.1 of the License, or (at your option) any later version.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *  Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public
 *  License along with this library; if not, write to the Free Software
 *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 * 
 * Jul 24, 2007
 * EasyPea.java
 * </pre>
 */
package org.easypeas.annotations;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * <p>
 * An EasyPea acts as Controller, and had views over parts of it, can perform
 * actions and can provide accessors to other EasyPeas's.<br>
 * It can also act as a collection if other identifiable EesyPeas, accessed
 * through the special accessor id(String id). This method (currently) doesn't
 * need annotating.
 * </p>
 * <p>
 * An EasyPea acts rather like a Java Bean, but is less rigid. Methods can be
 * named as your choose, the annotation identities their purpose.<br>
 * Of course, following a suitable convention in naming is advised, but this
 * convention is entirely up to you.<br>
 * <br>
 * The only particular constraint is that an EasyPea <b>must have a default
 * constructor</b>. <br>
 * For your EasyPea to be discovered it must also be defined in
 * /WEB-INF/easypeas.classes by its fully qualified class name. <br>
 * An EasyPea is mapped to the first part of the URL path by the <em>name</em>
 * attribute.
 * 
 * @see Action
 * @see View
 * @see Accessor
 * 
 * @author S Owen
 * 
 */
@Retention(value = RetentionPolicy.RUNTIME)
@Target(value = ElementType.TYPE)
public @interface EasyPea {
	/**
	 * * Provides a name to the EasyPea which must be unique.<br>
	 * The name maps to the very start of a HTTP GET or POST URL path.<br>
	 * e.g. GET /books/ => will indicate an EasyPea named <em>books</em>
	 */
	String name();

}
